#ifndef __PCPT_COMM_FILTER_H__
#define __PCPT_COMM_FILTER_H__

#include "comm/comm_base.h"
#include "comm/comm_cfg_param.h"
#include "pcpt_comm/pcpt_comm_format.h"

#include <pcl/filters/crop_box.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/filters/radius_outlier_removal.h>

using namespace std;

/**************************************************************************************
功能描述: 点云滤波
修改记录:
**************************************************************************************/
class POINT_CLOUD_FILTER_C
{
public:
    POINT_CLOUD_FILTER_C()
      : pobjPcptVoxel(NULL),
        searchRadius_(0),
        searchSteps_(0)
    {}
    
    ~POINT_CLOUD_FILTER_C() {}

    void VoxelGridFilter(MyCloud::Ptr pCloud, float leafSize) const; 
    void VoxelGridFilter(MyCloud::Ptr pCloud, float length, float width, float height) const;

    void VoxelGridFilter(pcl::PointCloud<pcl::PointXYZ>::Ptr pCloud, float leafSize) const;
    void VoxelGridFilter(pcl::PointCloud<pcl::PointXYZ>::Ptr pCloud, float length, float width, float height) const;
    
    void ConditionFilter(MyCloud::Ptr pCloud, const CUBOID_STRU &stCuboid) const;
    
    void RadiusOutlierFilterByPcl(MyCloud::Ptr pCloud, float searchRadius, INT32 minNeighbors);
    void RadiusOutlierFilterByVoxel(MyCloud::Ptr pCloud, float searchRadius, INT32 minNeighbors,
                                    CUBOID_STRU &stCuboid, float voxelSize);

private:
    PCPT_VOXEL_C*   pobjPcptVoxel;

    float           searchRadius_;
    INT32           searchSteps_;
};



#endif


